package com.ruoyi.system.task;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.atomic.AtomicInteger;

@Slf4j
public class ByExportThreadFileTask  implements Runnable {

    private ByExportFileProcessorWrapper byExportFileProcessorWrapper;

    /**
     */
    public ByExportThreadFileTask(String userId, AtomicInteger allCount, AtomicInteger failCount, AtomicInteger successCount) {
        byExportFileProcessorWrapper = new ByExportFileProcessorWrapper();
        byExportFileProcessorWrapper.init(userId, allCount, failCount, successCount);
    }

    public void setKeyword(String keyword) {
        byExportFileProcessorWrapper.setKeyword(keyword);
    }
    public void setA101(String a101) {
        byExportFileProcessorWrapper.setA101(a101);
    }
    public void setA200(String a200) {
        byExportFileProcessorWrapper.setA200(a200);
    }
    public void setStandardType(String standardType) {
        byExportFileProcessorWrapper.setStandardType(standardType);
    }
    public void setTaskId(int taskid) {
        byExportFileProcessorWrapper.setTaskId(taskid);
    }

    @Override
    public void run() {
        // no matter what happened, can't effected the main process.
        try {
            byExportFileProcessorWrapper.execute();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }
    }

}
